package com.efuture.io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * @ClassNAME OutputStreamWriterTest
 * @Description OutputStreamWriter的使用 将字节输出流转成字符输出流
 * @Author zhaoshanshan
 * @Date 2021/9/8 8:46 下午
 * @Version 1.0
 */
public class OutputStreamWriterTest {

    public static void main(String[] args) {
        OutputStreamWriter osw = null;
        try{
            osw = new OutputStreamWriter(new FileOutputStream("javasestudy/src/com.efuture.io/TestFileFour.txt"));
            osw.write("我是OutputStreamWriter\n你会用了吗?");
            osw.flush();
        }catch (Exception e){
            e.getStackTrace();
        }finally {
            if(null!=osw){
                try {
                    osw.close();
                    osw = null;
                } catch (IOException e) {
                    e.printStackTrace();
                }

            }
        }
    }
}